<!--
 * @Author: wangjh wangjiahui0710@163.com
 * @Date: 2024-07-10 09:19:29
 * @LastEditors: wangjh wangjiahui0710@163.com
 * @LastEditTime: 2024-07-11 15:30:35
 * @FilePath: \cip-admin\src\pages\company\information\person\components\sheet-item.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<!-- 表格内容,此组件还用于生成导出文件,所以不应该依赖vue组件相关的上下文 -->
<script lang="ts" setup>
import { DUTY_STATUS_MAP } from "@/config/enum-map";
import { toDayjs } from "@/utils/to-dayjs";

defineOptions({ name: "SheetItem" });
</script>

<template>
	<el-table-column label="序号" type="index" width="60" fixed="left" />
	<el-table-column label="人员姓名" prop="realName" />
	<el-table-column label="联系电话" prop="phone" />
	<el-table-column label="部门" prop="部门" />
	<el-table-column label="职务" prop="job" />
	<el-table-column v-slot="{ row }" label="入职时间" prop="entryDate">
		{{ !row.entryDate ? "-" : toDayjs(row.entryDate).format("YYYY-MM-DD") }}
	</el-table-column>
	<el-table-column v-slot="{ row }" label="在职状态" prop="dutyStatus">
		<el-text
			:type="
				+row.dutyStatus === 1
					? 'success'
					: +row.dutyStatus === 0
						? 'danger'
						: 'info'
			"
		>
			{{ DUTY_STATUS_MAP[row.dutyStatus] ?? "-" }}
		</el-text>
	</el-table-column>
	<el-table-column label="身份证号" prop="idNum" />
</template>
